using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_HGUI_HGUIMesh_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.HGUI.HGUIMesh);
            args = new Type[]{typeof(huqiang.Core.HGUI.HImage)};
            method = type.GetMethod("CreateMesh", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CreateMesh_0);

            field = type.GetField("Triangle", flag);
            app.RegisterCLRFieldGetter(field, get_Triangle_0);
            app.RegisterCLRFieldSetter(field, set_Triangle_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Triangle_0, AssignFromStack_Triangle_0);
            field = type.GetField("Rectangle", flag);
            app.RegisterCLRFieldGetter(field, get_Rectangle_1);
            app.RegisterCLRFieldSetter(field, set_Rectangle_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Rectangle_1, AssignFromStack_Rectangle_1);
            field = type.GetField("TowRectangle", flag);
            app.RegisterCLRFieldGetter(field, get_TowRectangle_2);
            app.RegisterCLRFieldSetter(field, set_TowRectangle_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_TowRectangle_2, AssignFromStack_TowRectangle_2);
            field = type.GetField("FourRectangle", flag);
            app.RegisterCLRFieldGetter(field, get_FourRectangle_3);
            app.RegisterCLRFieldSetter(field, set_FourRectangle_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_FourRectangle_3, AssignFromStack_FourRectangle_3);
            field = type.GetField("FourCorners", flag);
            app.RegisterCLRFieldGetter(field, get_FourCorners_4);
            app.RegisterCLRFieldSetter(field, set_FourCorners_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_FourCorners_4, AssignFromStack_FourCorners_4);
            field = type.GetField("ElevenRectangle", flag);
            app.RegisterCLRFieldGetter(field, get_ElevenRectangle_5);
            app.RegisterCLRFieldSetter(field, set_ElevenRectangle_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_ElevenRectangle_5, AssignFromStack_ElevenRectangle_5);
            field = type.GetField("TwelveRectangle", flag);
            app.RegisterCLRFieldGetter(field, get_TwelveRectangle_6);
            app.RegisterCLRFieldSetter(field, set_TwelveRectangle_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_TwelveRectangle_6, AssignFromStack_TwelveRectangle_6);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.HGUI.HGUIMesh());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.HGUI.HGUIMesh[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* CreateMesh_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.HImage @image = (huqiang.Core.HGUI.HImage)typeof(huqiang.Core.HGUI.HImage).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            huqiang.Core.HGUI.HGUIMesh.CreateMesh(@image);

            return __ret;
        }


        static object get_Triangle_0(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.Triangle;
        }

        static StackObject* CopyToStack_Triangle_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.Triangle;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Triangle_0(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.Triangle = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_Triangle_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @Triangle = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.Triangle = @Triangle;
            return ptr_of_this_method;
        }

        static object get_Rectangle_1(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.Rectangle;
        }

        static StackObject* CopyToStack_Rectangle_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.Rectangle;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Rectangle_1(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.Rectangle = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_Rectangle_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @Rectangle = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.Rectangle = @Rectangle;
            return ptr_of_this_method;
        }

        static object get_TowRectangle_2(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.TowRectangle;
        }

        static StackObject* CopyToStack_TowRectangle_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.TowRectangle;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_TowRectangle_2(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.TowRectangle = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_TowRectangle_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @TowRectangle = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.TowRectangle = @TowRectangle;
            return ptr_of_this_method;
        }

        static object get_FourRectangle_3(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.FourRectangle;
        }

        static StackObject* CopyToStack_FourRectangle_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.FourRectangle;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_FourRectangle_3(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.FourRectangle = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_FourRectangle_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @FourRectangle = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.FourRectangle = @FourRectangle;
            return ptr_of_this_method;
        }

        static object get_FourCorners_4(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.FourCorners;
        }

        static StackObject* CopyToStack_FourCorners_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.FourCorners;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_FourCorners_4(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.FourCorners = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_FourCorners_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @FourCorners = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.FourCorners = @FourCorners;
            return ptr_of_this_method;
        }

        static object get_ElevenRectangle_5(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.ElevenRectangle;
        }

        static StackObject* CopyToStack_ElevenRectangle_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.ElevenRectangle;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_ElevenRectangle_5(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.ElevenRectangle = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_ElevenRectangle_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @ElevenRectangle = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.ElevenRectangle = @ElevenRectangle;
            return ptr_of_this_method;
        }

        static object get_TwelveRectangle_6(ref object o)
        {
            return huqiang.Core.HGUI.HGUIMesh.TwelveRectangle;
        }

        static StackObject* CopyToStack_TwelveRectangle_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.HGUI.HGUIMesh.TwelveRectangle;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_TwelveRectangle_6(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIMesh.TwelveRectangle = (System.Int32[])v;
        }

        static StackObject* AssignFromStack_TwelveRectangle_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32[] @TwelveRectangle = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIMesh.TwelveRectangle = @TwelveRectangle;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Core.HGUI.HGUIMesh();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
